function DialogObj() {
	this.dialogParam = {
		title: '',
		content: '',
		button: {
			yes: {
				'msg': '',
				'callback': '',
				'isexist':true,
			},
			no: {
				'msg': '',
				'callback': '',
				'isexist':true,
			}
		}

	};
	this.currentDialogObj='';
}

DialogObj.prototype = {
	"showConfirm":function(title,content,buttonArray){
		this.dialogParam.title=title;
		this.dialogParam.content=content;
		this.dialogParam.button=buttonArray;
		var html=this.formConfirmHtml();
		var textnode=document.createElement('div');
		textnode.innerHTML=html;
		this.currentDialogObj=textnode;
		document.getElementsByTagName('body')[0].appendChild(textnode);
		
		var nobutton=document.getElementById("dialog-cancel");
		var yesbutton=document.getElementById("dialog-confrim");
		yesbutton.addEventListener('tap',this.dialogParam.button.yes.callback);
		nobutton.addEventListener('tap',this.dialogParam.button.no.callback);
	},
	'formConfirmHtml': function() {
		var html = '<div class="black_bg"></div>' +
			'<div class="dialog-content">' +
			'<p class="colorblue title  text-center">' + this.dialogParam.title + '</p>' +
			'<div class="line"></div>' +
			'<div class="dialogContent">' + this.dialogParam.content+'</div>' +
			'<div class="buttons text-center">';
		if(this.dialogParam.button.yes.isexist) {
			html+='<button id="dialog-cancel">'+this.dialogParam.button.no.msg+'</button>';
		}
		if(this.dialogParam.button.no.isexist) {
			html+='<button class="confrim"  id="dialog-confrim">'+this.dialogParam.button.yes.msg+'</button>';
		}
		
		
		html+='</div></div>';
		return html;
	}
}